<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStaffTaskTable extends Migration
{
    /**
     * Run the migrations.
     * 员工任务表
     * @return void
     */
    public function up()
    {
        Schema::create('staff_task', function (Blueprint $table) {
            $table->increments('id');
	        $table->integer('task_id')->comment('任务id');
	        $table->integer('staff_id')->comment('员工id');
	        $table->integer('store_station_id')->comment('店铺岗位id')->nullable();
	        $table->integer('store_id')->comment('店铺id');
	        $table->dateTime('receive_time')->comment('任务接取时间')->nullable();
	        $table->dateTime('termination')->comment('任务终止时间')->nullable();
	        $table->integer('is_agree')->comment('是否同意终止结算')->nullable();
	        $table->integer('status')->comment('接单状态：1申请中，2接单失败，3等待排班，4进行中，5已结束，6任务终止');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('staff_task');
    }
}
